package com.weiyuwqj.server.mapper;

import com.weiyuwqj.api.model.BusRepayOrder;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.math.BigDecimal;
@Repository
public interface BusRepayOrderMapper extends Mapper<BusRepayOrder> {

    //根据订单号查询单条数据
    BusRepayOrder getOneByOderNo(String orderNo);

    //根据itemId统计已完成的金额
    BigDecimal countRepayAmountByItemId(@Param("itemId")Integer itemId,@Param("status")Integer status);

    //根据项目id查询最新一条已还款记录
    BusRepayOrder getRepayOrderByItemId(Integer itemId);

    //根据itemId查询最新的提前还款记录
    BusRepayOrder getRepayOrderPrepaymentByItemId(Integer itemId);
}